<extend name="./Application/Admin/View/Layout/application.html"/>

<block name="css">
    <style>
        #page2{
            display:none;
        }
    </style>
</block>

<block name="content">
    <div class="row">
        <div class="col-md-9">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title">站点信息</h3>
                </div>
                <div class="panel-body">
                    <form class="form-horizontal" action="" method="post">
                        <div id="page1">
                            <div class="form-group">
                                <label for="name" class="col-sm-2 control-label">网站名称</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control" name="name" id="name" value="{{$site.name}}" placeholder="请输入网站名称">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="keyword" class="col-sm-2 control-label">关键词</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control" id="keyword" value="{{$site.keyword}}" placeholder="请输入关键词">
                                </div>
                            </div>

                            <div class="form-group">
                                <label for="icp" class="col-sm-2 control-label">ICP备案号</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control" id="icp" value="{{$site.icp}}" placeholder="请输入备案号">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="copyRight" class="col-sm-2 control-label">版本信息</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control" id="copyright" value="{{$site.copyright}}"
                                           placeholder="请输入版本信息">
                                </div>
                            </div>
                        </div>

                        <div id="page2">
                            <div class="form-group">
                                <label for="username" class="col-sm-2 control-label">管理员</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control" value="{{$_SESSION['user']['username']}}" id="username">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="company" class="col-sm-2 control-label">公司名称</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control"  id="company" value="{{$site.company}}"
                                           placeholder="请输入公司名称">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="qq" class="col-sm-2 control-label">QQ</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control" id="qq" value="{{$site.qq}}" placeholder="请输入qq号">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="email" class="col-sm-2 control-label">电子邮件</label>
                                <div class="col-sm-10">
                                    <input type="email" class="form-control" id="email" value="{{$site.email}}"
                                           placeholder="请输入电子邮件">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="phone" class="col-sm-2 control-label">手机号码</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control" id="phone" value="{{$site.phone}}"
                                           placeholder="请输入手机号码">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="telephone" class="col-sm-2 control-label">固定号码</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control" id="telephone" value="{{$site.telephone}}"
                                           placeholder="请输入固定电话">
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="fax" class="col-sm-2 control-label">传真</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control" id="fax" value="{{$site.fax}}" placeholder="请输入传真号码">
                                </div>
                            </div>
                        </div>

                        <div class="form-group">
                            <div class="col-sm-offset-2 col-sm-10">
                                <button type="button" class="btn btn-primary prev" disabled>返 回</button>
                                <button type="button" class="btn btn-primary next">下一页</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>

        <div class="col-md-3">

        </div>
    </div>
</block>


<block name="js">
    <script >
        $(function(){
            var $page1 = $("#page1");
            var $page2 = $("#page2");
            var $next = $(".next");
            var $prev = $(".prev");

            $next.click(function(){
                if($(this).text() == '提 交'){
                    $("form").submit();
                }

                $page1.hide(300);
                $page2.show(300);
                $prev.prop('disabled', false);
                $next.text('提 交');
            });

            $prev.click(function () {
                $page2.hide(300);
                $page1.show(300);
                $prev.prop('disabled', true);
                $next.text('下一页');


            });
        })

    </script>
</block>